package com.net.io.netty.serialize.protobuf;

/**
 * @author zhangtengfei
 * @date 2022/2/16 17:48
 */
public class PersonProto {

    public static class Person {
        Integer id;
        String name;
        String email;

        public Integer getId() {
            return id;
        }

        public String getName() {
            return name;
        }

        public String getEmail() {
            return email;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public void setName(String name) {
            this.name = name;
        }

        public void setEmail(String email) {
            this.email = email;
        }

        public static Builder newBuilder() {
            return new Builder();
        }

        public static Person getDefaultInstance() {
            return Person.newBuilder().setId(1).build();
        }

        public static class Builder {

            private Person person = new Person();

            Builder setId(Integer id) {
                person.setId(id);
                return this;
            }

            Builder setName(String name) {
                person.setName(name);
                return this;
            }

            Builder setEmail(String email) {
                person.setEmail(email);
                return this;
            }

            public Person build() {
                return person;
            }
        }
    }
}
